<!--  -->
<template>
  <div>
    <!-- 密码输入框 -->
    <van-cell  @click="showPopup"></van-cell>
<van-popup v-model="show" position="bottom" :style="{ height: '70%' }">
  <van-nav-bar
      title="付款"
      @click-left="onClickLeft"
      left-arrow
     
     
    >
    <template #left>
    <van-icon name="cross" size="18" />
  </template>
    </van-nav-bar>
  <van-password-input
  :value="value"
  info="密码为 6 位数字"
  
/>

    
<!-- 数字键盘 -->
<van-number-keyboard
  v-model="value"
  :show="true"
  @input="hqjpz"
/></van-popup>
  

   

  </div>
</template>

<script>
import { fukuan } from "network/api.js";
export default {
    name:'',
  data () {
    return {
       value: '',
       showKeyboard:true,
       show:false
      
    };
  },

props:["djfd"]
  
,
  computed: {},
    // created(){
    //     this.hh()
    // },

  methods: {
    showPopup(){
      this.show=true
    },
      onClickLeft(){
        this.show=false
        this.$router.push({path:"/dingdanxq",query:{id:this.djfd}})
      },
      hqjpz(){
        this.$nextTick(async ()=>{
          if(this.value.length>=6){
            const {errcode,errmsg}=await fukuan(this.djfd,{pay_password:this.value})
            if(errcode!=0) {
              this.value=""
              return this.$toast(errmsg)}
           
            this.$router.push("/fukuanchenggong")
          }
        })
        
      }
  }
}

</script>
<style less scoped>
</style>